//index.js
const app = getApp()

Page({
  data: {
    
  },

  req() {
    wx.login({
      success(res) {
        wx.request({
          url: 'https://chamjoy.store/teenager/register.php',
          data: {
            code: res.code,
            name: '1',
            phone: '1',
            college: '1',
            region: '1',
            register_time: new Date(),
          },
          method: "POST",
          success(res) {
            console.log(res)  
          },
        })
      },
    })
   
  },

  sendsms() {
    wx.cloud.callFunction({
      name: 'sendsms',
      data: {
        mobile: '19858192048',
        templateId: 669301,
        smsSign: "舒悦酒店",
        params: ['：1234', '10']
      },
      success: res => {
        console.log('[sendsms] 调用成功')
        console.log(res)
      },
      fail: err => {
        console.error('[sendsms] 调用失败', err)
      }
    })
  },

})
